package com.shoulei.designpattern.factorypattern;

/**
 * @ClassName:ShapeFactory
 * @Descrition:
 * @Author:shoulei
 * @Date:2019/3/31 16:35
 * @Verson:
 */
public class ShapeFactory {
    public Shape getShape(String shapeType){
        if(shapeType == null){
            return  null;
        }
        if(shapeType.equalsIgnoreCase("rectangle")){
            return new Rectangle();
        }else if(shapeType.equalsIgnoreCase("square")){
            return new Square();
        }else if(shapeType.equalsIgnoreCase("circle")){
            return new Circle();
        }
        return null;
    }
}
